<?php
# ***** BEGIN LICENSE BLOCK *****
# This file is part of "myWiWall".
# Copyright (c) 2007-2008 CRP Henri Tudor and contributors.
# All rights reserved.
#
# "myWiWall" is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
# 
# "myWiWall" is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with "myWiWall"; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# ***** END LICENSE BLOCK *****


/**
* @package myWiWall
* @author Laurent Haan <laurent.haan@gmail.com>
*/

/* display the login form */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<title><?php echo APPNAME; ?> Login</title>
	
	<link rel="stylesheet" type="text/css" href="../../views/<?php echo $GLOBALS['dir_theme']; ?>css/common.css" />
	<link rel="stylesheet" type="text/css" href="../../views/<?php echo $GLOBALS['dir_theme']; ?>css/forms.css" />
	<link rel="stylesheet" type="text/css" href="../../views/<?php echo $GLOBALS['dir_theme']; ?>css/login.css" />
  	<?php include dirname(__FILE__) . "/../${GLOBALS['dir_theme']}partials/x-browser.tpl"; ?>
  
	<script type="text/javascript" src="../../js/jquery/jquery.js"></script>
	<script type="text/javascript">
	$(document).ready(function(){
		$('#username').focus();
	});
	</script>
</head>
<body>
	

	<form id="authForm" action="../../index.php/users/authenticate" method="post">
	<fieldset>
		<legend><?php echo APPNAME; ?> <?php echo __("Login"); ?></legend>
		
		<?php if (isset($message)): ?>
		<div id="<?php echo ($isError) ? 'error' : 'message'; ?>"><?php echo $message ?></div>
		
		<?php endif; ?>
		<div class="form_line">
			<label for="username"><?php echo __('Username'); ?></label>
			<input type="text" id="username" name="username" class="text" tabindex="1"/>
		</div>
		<div class="form_line">
			<label for="password"><?php echo __('Password'); ?></label>
			<input type="password" id="password" name="password" class="text" tabindex="2"/>
		</div>
		<?php if (OPENID_SSO_MODE): ?>
		<div class="form_line" id="use_openid">
		<?php echo __("OR login with your OpenId"); ?>:
		</div>
		<div class="form_line">
			<label for="openid"><?php echo __('OpenID'); ?></label>
			<input type="text" id="openid" name="openid" class="text" tabindex="5"/>
		</div>
		<?php endif; ?>
		
		<div class="submit">
			<input type="hidden" value="<?php echo $redirectionAfterLogin; ?>" name="ref"/>
			<input type="submit" class="button" value="<?php echo __('Login'); ?>" id="auth" name="auth" tabindex="6"/>
			<input type="reset" class="button" value="<?php echo __('Reset'); ?>" tabindex="7"/>
		</div>
		
		<div id="createAccount">
			<h2><?php echo __("Not registered yet ?"); ?></h2>
			<?php echo __("Create your own user account and try it by yourself !"); ?>
			<a href="../../index.php/users/register"><?php echo __('Register !'); ?></a>
		</div>
		
		<?php if ($installWarning): ?>
		<div class="install_warning">
			<?php echo __("The installation folder ('/install') was not deleted after installation ! Please delete it to ensure the security of your portal !"); ?>
		</div>
		<?php endif; ?>
		
		<?php if ($rootUserWarning): ?>
		<div class="install_warning">
			<?php echo __("The root user's password has not been changed ! Please change it to ensure the security of your portal !"); ?>
		</div>
		<?php endif; ?>
		
	</fieldset>
	</form>
	
	<div id="footer">
		<a href="http://palette.ercim.org"><img class="footer_logo" src="../../views/<?php echo $GLOBALS['dir_theme']; ?>img/logo.png" alt="<?php echo __("PALETTE is an Integrated Project supported by the IST programme of the European Commission"); ?>" title="<?php echo __("PALETTE is an Integrated Project supported by the IST programme of the European Commission"); ?>"/></a>
		<a href="http://europa.eu"><img class="footer_logo" src="../../views/<?php echo $GLOBALS['dir_theme']; ?>img/footer-eu.png" alt="<?php echo __("PALETTE is an Integrated Project supported by the IST programme of the European Commission"); ?>" title="<?php echo __("PALETTE is an Integrated Project supported by the IST programme of the European Commission"); ?>"/></a>
		<a href="http://www.tudor.lu"><img class="footer_logo" src="../../views/<?php echo $GLOBALS['dir_theme']; ?>img/footer-tudor.png" alt="<?php echo __("Public Research Center Henri Tudor"); ?>" title="<?php echo __("Centre de Recherche Public Henri Tudor"); ?>"/></a>
		<p>
			<?php echo __("Copyright 2007-2008 Public Research Center Henri Tudor."); ?>
		</p>
	</div>
</body>
</html>